/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mavenrentcars.service;

import com.mavenrentcars.exception.ViewException;
import com.mavenrentcars.form.AccountForm;
import com.mavenrentcars.model.User;
import java.util.ArrayList;
import java.util.Collection;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 *
 * @author student
 */
public interface AccountService extends GenericService<User, Integer>, UserDetailsService {

    public User saveAccount(AccountForm form) throws ViewException;

    public User setAuthentication(String user, String password, Collection<GrantedAuthority> authorities);

    public User getLoggedInAccount();

    public User getAccountByLogin(String login);

    public boolean hasOneRole(String role);

    public boolean hasRole(ArrayList<String> roles);

    public void setRole(User account, String roleName);

    public String getRole();

    public void logout();
}
